package main

import (
	"fmt"
	"time"
)

/*
   Author: mahaiyuan
   Date: 2021/7/26 8:35 下午
   Description:
*/
const layout = "2006-01-02 15:04:05"
func main() {
	now := time.Now().Format(layout)	// 北京时区 东八区
	fmt.Printf("current time is : %s \n", now)
	location, _ := time.LoadLocation("Asia/Tokyo")	// 东京时区 东九区
	now2 := time.Now().In(location).Format(layout)
	fmt.Printf("current time is : %s \n", now2)

	timeStr := "2021-07-26 20:41:03"
	parse, _ := time.Parse(layout, timeStr)
	time3 := parse.Format(layout)
	fmt.Printf("time3 is : %s \n", time3)

}
